package com.cskaoyan._02interface._08extend;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/13 10:22
 **/
/*
链式调用:
 */
public class Demo {
    public static void main(String[] args) {
        Student sd = new Student();
        Teacher t = sd.getTeacher();
        t.show();

        // 链式调用
        new Student().getTeacher().show();
    }
}

class Student{

    public Student getStudent(){
        return new Student();
    }

    public Teacher getTeacher(){
        return new Teacher();
    }
}
class Teacher{
    public void show(){
        System.out.println("秀一波~~~");
    }
}